package com.ldp.designpatterns.study.flyweight;

import com.ldp.designpatterns.study.flyweight.factory.ChessFactory;
import com.ldp.designpatterns.study.flyweight.flyAbstract.Chess;

import java.util.Random;

/**
 * @ClassName FlyweightTest
 * @Description TODO
 * @Author lindipei
 * @Date 2023/10/17 17:02
 */
public class FlyweightTest {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            Chess c = ChessFactory.getChess(i % 2);
            c.play(i, new Random().nextInt(15));
        }
    }
}
